const moment = require('moment');
function getName() {
    const now = new Date();
    const nowTime = now.getTime() ;
    const day = now.getDay();
    const oneDayTime = 24*60*60*1000 ;
    const MondayTime = nowTime - (day-1)*oneDayTime ;//显示周一
    const SundayTime =  nowTime + (7-day)*oneDayTime ;//显示周日
    //console.log(new Date(MondayTime));
    //console.log(new Date(SundayTime))
    return {
        startTime:moment(new Date(MondayTime)).format("YYYY-MM-DD 00:00:00"),
        endTime:moment(new Date(SundayTime)).format("YYYY-MM-DD 23:59:59"),
    }
}

console.log(getName())